#include <bits/stdc++.h>
using namespace std;
//使用一维vector存储数据，需要col和row
int max_value(vector<int>&a,int col,int row)
{
    stack<int> result;
    result.push(a[0]);//使用栈保存数据，直接top获取最大值
    for(int r=0;r<row;)
    {
        for(int c=0;c<col;)
        {
            int right_value = a[row*r+c+1];
            int down_value = a[row*(r+1)+c];
            if(right_value>down_value)
                c++;
            else
                r++;
            int select_value = max(right_value,down_value);//选中更大的值
            result.push(select_value);//将中间选择结果存入栈
        }
    }
    return result.top();

}

int main()
{
    vector<int> price={1,11,14,22,13,15,24,30,18,25,29,41,21,32,48,53};
    cout<<max_value(price,3,3);
}